package ObserverPattern;

/**
 * @Author: zhaojie
 * @Date: Created in 17:32 2018/6/25
 * @Description: 观察者模式
 */
public class ObserverPatternDemo {


    public static void main(String[] args) {
        Subject subject = new Subject();
        new HexaObserver(subject);
        new OctalObserver(subject);
        new BinaryObserver(subject);
        new HelloObserver(subject);

        System.out.println("First state change: 15");
        subject.setState(15);
        System.out.println("Second state change: 10");
        subject.setState(10);
    }
}
